﻿<UserControl x:Class="cmdr.Editor.Views.CommandEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="boolToVisConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Visibility="{Binding IsAssignmentEnabled, Mode=OneWay, Converter={StaticResource boolToVisConverter}}">
            <Label>Assignment:</Label>
            <ComboBox ItemsSource="{Binding AssignmentOptions, Mode=OneWay}" SelectedValue="{Binding Assignment}" SelectedValuePath="Key" DisplayMemberPath="Value"/>
        </StackPanel>
        <Grid Grid.Row="1" Visibility="{Binding IsControlEnabled, Mode=OneWay, Converter={StaticResource boolToVisConverter}}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Column="0">
                <Label>Control:</Label>
                <ComboBox ItemsSource="{Binding ControlTypeOptions, Mode=OneWay}" SelectedValue="{Binding ControlType}" SelectedValuePath="Key" DisplayMemberPath="Value" />
            </StackPanel>
            <StackPanel Grid.Column="1">
                <Label>Interaction:</Label>
                <ComboBox ItemsSource="{Binding ControlInteractionOptions, Mode=OneWay}" SelectedValue="{Binding  InteractionMode}" SelectedValuePath="Key" DisplayMemberPath="Value" />
            </StackPanel>
        </Grid>
        <ContentPresenter Grid.Row="2" Visibility="{Binding IsControlEnabled, Mode=OneWay, Converter={StaticResource boolToVisConverter}}" Content="{Binding SettingsContent}"/>
        <ContentPresenter Grid.Row="3" Visibility="{Binding IsControlEnabled, Mode=OneWay, Converter={StaticResource boolToVisConverter}}" Margin="0,10,0,0" Content="{Binding ControlSettingsContent}"/>
    </Grid>
</UserControl>
